package com.dst.smart.webservice;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.os.AsyncTask;

import com.dst.smart.constant.Constants;

public class SettingServiceUtils {

	static String endPoint = Constants.CHNIES + "Service/SettingService.asmx";
	static String NAMESPACE = "http://tempuri.org/";

	public static String getVersion(String SetVersion)
			throws Exception {
		String methodName = "getVersion";
		String soapAction = NAMESPACE + methodName;
		SoapObject rpc = new SoapObject(NAMESPACE, methodName);
		rpc.addProperty("SetVersion", SetVersion);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		envelope.bodyOut = rpc;
		envelope.dotNet = true;
		envelope.setOutputSoapObject(rpc);
		HttpTransportSE transport = new HttpTransportSE(endPoint);
		transport.call(soapAction, envelope);
		SoapObject object = (SoapObject) envelope.bodyIn;
		return object.getProperty(0).toString();
	}

}
